<?php

namespace App\Repositories;

use App\Exceptions\BasicException;
use Illuminate\Support\Facades\Hash;
use function Matrix\add;    //引入hash

class GameSpecialUserRepository {

    /*
     * 获取独立奖池列表
     * @param $where
     * @return bool
     * @throws BasicException
     *
     * */
    public function getGiftList($where) {
        $getGiftList = app('model_game_special_user')
            ->where($where)
            ->select('id','user_id','add_time','state','type','pool_type')
            ->orderBy('id','desc')
            ->with('user_data:user_id,user_code,nickname,head_picture')
            ->get()->toArray();
        return $getGiftList;
    }

     /*
     * 新增独立奖池用户
     * @param $param
     * @return bool
     * @throws BasicException
     *
     * */
     public function addUserPool($param){
         $addUserPool = app('model_game_special_user')->create($param);
         if ($addUserPool) return $addUserPool;
         throw new BasicException(93086);
     }
        /*
    * 删除满足条件的数据
    * @param $where
    * @return bool
    * @throws BasicException
    *
    * */

    public function  delWhere($where){
         app('model_game_special_user')->where($where)->delete();
    }






}


?>